﻿using JBeamLibrary.VehicleParts.Collections;
using JBeamLibrary.VehicleParts.Elements;
using JBeamLibrary.VehicleParts.Groups;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JBeamLibrary.VehicleParts.Groups
{
    public class BeamSection : VehicleSection<Beam>
    {
        #region Fields

        private readonly BeamCollection _collection = new BeamCollection();

        #endregion

        #region Indexers

        public Beam this[string nodeId1, string nodeId2]
        {
            get
            {
                return _collection.FirstOrDefault(beam => beam.NodeId1.Equals(nodeId1) && beam.NodeId2.Equals(nodeId2));
            }
        }

        #endregion

        #region CTORs

        public BeamSection(VehiclePart part)
            : base(part)
        {

        }

        #endregion

        #region VehicleSection

        public override string Name
        {
            get { return "beams"; }
        }

        public override Interfaces.IVehicleGroupCollection<Beam> ElementCollection
        {
            get { return _collection; }
        }

        #endregion
    }
}
